package com.dzx.design.behavioral.observer;

import lombok.Data;

import java.util.Observable;

/**
 * @author dzx
 * @ClassName:
 * @Description:
 * @date 2019年08月14日 14:52:15
 */
@Data
public class Course extends Observable {

    private String courseName;

    public Course(String courseName) {
        this.courseName = courseName;
    }

    public void produceQuestion(Course course, Question question) {
        System.out.println(question.getUserName() + "在"+course.courseName+"提交了一个问题");
        setChanged();
        notifyObservers(question);
    }
}
